package com.atmosphere.interfaces;

/**
 * <code>IAtmosphere</code> defines the interface of the central
 * control unit of the atmosphere system. Various atmosphere
 * components are required to be attached to this unit in order
 * for them to be properly updated and rendered.
 *
 * @author Yi Wang (Neakor)
 * @version Creation date: 05-19-2009 14:49 EST
 * @version Modified date: 05-21-2009 11:21 EST
 */
public interface IAtmosphere {

	/**
	 * Attach the given component to the system.
	 * <p>
	 * This method should only be invoked when all the essential
	 * parameters of the component is set.
	 * @param component The <code>IComponent</code> to be attached.
	 * @return The attachment success <code>Boolean</code> flag.
	 */
	public boolean attachComponent(IComponent component);
	
	/**
	 * Detach the given component from the system.
	 * @param component The <code>IComponent</code> to be detached.
	 * @return The detachment success <code>Boolean</code> flag.
	 */
	public boolean detachComponent(IComponent component);
	
	/**
	 * Detach the component with given key from the system.
	 * @param key The <code>IComponentKey</code> key to check.
	 * @return The detachment success <code>Boolean</code> flag.
	 */
	public boolean detachComponent(IComponentKey key);
	
	/**
	 * Set the ending time of day-time.
	 * @param hour The <code>Integer</code> 24-hour system hour.
	 * @param min The <code>Integer</code> 60-minute system minute.
	 */
	public void setDayEnd(int hour, int min);

	/**
	 * Set the starting time of day-time.
	 * @param hour The <code>Integer</code> 24-hour system hour.
	 * @param min The <code>Integer</code> 60-minute system minute.
	 */
	public void setDayStart(int hour, int min);
	
	/**
	 * Set the ending time of night-time.
	 * @param hour The <code>Integer</code> 24-hour system hour.
	 * @param min The <code>Integer</code> 60-minute system minute.
	 */
	public void setNightEnd(int hour, int min);

	/**
	 * Set the starting time of night-time.
	 * @param hour The <code>Integer</code> 24-hour system hour.
	 * @param min The <code>Integer</code> 60-minute system minute.
	 */
	public void setNightStart(int hour, int min);
	
	/**
	 * Set the time of day-night transition-time.
	 * @param hour The <code>Integer</code> 24-hour system hour.
	 * @param min The <code>Integer</code> 60-minute system minute.
	 */
	public void setDayTransition(int hour, int min);

	/**
	 * Set the time of night-day transition-time.
	 * @param hour The <code>Integer</code> 24-hour system hour.
	 * @param min The <code>Integer</code> 60-minute system minute.
	 */
	public void setNightTransition(int hour, int min);
	
	/**
	 * Retrieve the component with given key.
	 * @param key The <code>IComponentKey</code> key to check.
	 * @return The <code>IComponent</code> with given ID.
	 */
	public IComponent getComponent(IComponentKey key);
	
	/**
	 * Retrieve the ending time of day-time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getDayEnd();

	/**
	 * Retrieve the starting time of day-time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getDayStart();
	
	/**
	 * Retrieve the ending time of night-time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getNightEnd();

	/**
	 * Retrieve the starting time of night-time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getNightStart();
	
	/**
	 * Retrieve the time of the day-night transition-time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getDayTransition();
	
	/**
	 * Retrieve the time of the night-day transition-time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getNightTransition();
	
	/**
	 * Retrieve the time difference between day-transition and day-end time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getDiffTransDay();
	
	/**
	 * Retrieve the time difference between night-start and day-transition time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getDiffNightTrans();
	
	/**
	 * Retrieve the time difference between night-transition and night-end time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getDiffTransNight();
	
	/**
	 * Retrieve the time difference between day-start and night-transition time.
	 * @return The <code>Float</code> time in 24-hour, 100-minute system.
	 */
	public float getDiffDayTrans();

	/**
	 * Clean up the system and all attached components.
	 */
	public void cleanup();
}
